import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useSideMenuStore = defineStore('counter', () => {
  const isCollapse = ref(false)
  function clickCollapse() {
    isCollapse.value = !isCollapse.value
  }
  /** 权限列表 */
  const permissions = ref<Array<string>>([]); // 用户权限编码集合 → 判断按钮权限
  /** 设置权限数据 */
  function setPermissions(data: string[]) {
    permissions.value = data;
  }

  return { isCollapse, clickCollapse, permissions, setPermissions}
})
